from drg_group.yinchuan_2023.Base import message,intersect,SS_VALID
from drg_group.yinchuan_2023.DRG import MDCB_DRG

def group(record):
  adrg_zd=["G45.000","G45.003","G45.100x002","G45.101","G45.400","G45.800","G45.800x003","G45.801","G45.802","G45.900","I63.000","I63.001","I63.002","I63.003","I63.100","I63.101","I63.102","I63.103","I63.200","I63.201","I63.202","I63.203","I63.204","I63.205","I63.206","I63.207","I63.208","I63.300","I63.302","I63.401","I63.402","I63.500","I63.500x002","I63.501","I63.502","I63.600x001","I63.801","I63.900","I63.900x007","I63.901","I63.902","I63.903","I63.904","I63.905","I63.906","I63.907","I63.908","I65.001","I65.002","I65.102","I65.103","I65.200x001","I65.200x015","I65.201","I65.202","I65.203","I65.204","I65.207","I66.001","I66.002","I66.003","I66.101","I66.201","I66.202","I66.300x005","I66.302","I66.304+G46.3*","I66.400","I66.400x003","I67.000x009","I67.200x002","I67.301","I67.500","I67.600x007","I67.601","I67.604","I67.605","I67.606","I67.800x005","I67.802","I67.806"]
  adrg_zd1=[]
  adrg_ss=[]
  adrg_ss1=[]
  adrg_ss2=[]
  dept_list=[]
  if True and record.zdList[0] in adrg_zd:
    message('符合BR2入组条件，匹配规则：主诊断匹配')
    
    if MDCB_DRG.BR21_group(record):
      return 'BR21'

    if MDCB_DRG.BR23_group(record):
      return 'BR23'

    if MDCB_DRG.BR25_group(record):
      return 'BR25'

    return 'BR2'
  else:
    return ''

